package com.share.design.status;

/**
 * author:caifan
 * date:2020/2/5
 */
public class LowState extends AbstractState {

    public LowState(ScoreContext context) {
        this.context = context;
        stateName = "不及格";
        score = 0;
    }

    public LowState(AbstractState state) {
        this.context = state.context;
        stateName = "不及格";
        score = state.score;
    }

    @Override
    public void checkState() {
        if(score >= 90) {
            context.setState(new HighState(this));
        } else if(score >= 60) {
            context.setState(new MiddleState(this));
        }
    }
}
